adTempus API
PreviousUpNext
IJob::GetEvents Method

Gets the log messages for the job

C++
HRESULT GetEvents(long maxRecords, long * foundRecords, [out,retval] ILogEvents ** pVal);
C#
GetEvents(long maxRecords, ref long foundRecords, [out,retval] ILogEvents * pVal);
Visual Basic
Sub GetEvents(maxRecords As long, ByRef foundRecords As long, pVal As [out,retval] ILogEvents *)
Parameters 
Description 
[in] long maxRecords 
The maximum number of records to retrieve. Use 0 to retrieve all records. 
[out] long * foundRecords 
The number of records actually found. 
[out,retval] ILogEvents ** pVal 
On return, contains a collection of the events. 

GetEvents gets all LogEvent records associated with this job. The data is refreshed from the server if necessary to get the latest information. 

Log messages are purged when the instance with which they are associated is purged, based on the job's HistoryRetentionOptions and HistoryRetentionLimit

The collection contains messages recorded at the job and the step level for all instances of the job. 

Because retrieving the data from the database and transmitting it to the client can be time-consuming, you can limit the number of records returned by using the maxRecords parameter. The returned collection is always sorted in descending order by the timestamp of the message, so if you limit the number of records to n, you will receive the most recent n messages. 

When the method returns foundRecords is set to the number of messages that actually exist for the job. User-interface applications therefore can first call the method with some reasonable value for maxRecords and then, if foundRecords exceeds this number, prompt the user before calling the method again to retrieve all records (this is the approach used by the adTempus Console). 

Each call only retrieves records that have been created since the last time the method was called, so calling the method frequently does not result in the same data being repeatedly sent from the server. 

If you are looking for specific messages, other approaches are better:

 

  • Use the GetObjectsWhere method of the Scheduler object to filter records on the server.
 

adTempus API Reference version 3.0.0.0, revised 10/30/2008